set

operator fun ElementAttributes.set(name: String, value: String)
operator fun ElementAttributes.set(name: String, value: String)

Adds a new attribute with the given name and value.

If an attribute with the given name is already specified, its value will be replaced with the new one.

Parameters

name

the name of the attribute to add or alter.

value

value to set in a string form. Can be empty for boolean attribute names which are always true despite the attribute value.

Throws

when {@code name} is empty or blank.